package love.lemoncat.websocket.msg;

import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

public interface Msg<T> {
    public static final String DEV_NO = "devNo";
    public static final String DATA_TYPE = "dataType";
    public static final String CONTENT = "data";
    public static final String ATTR = "attr";

    public static enum DataType {
        PARAM, LOG, STATUS;
    }



    String encode() throws Exception;

    T decode(String msg) throws Exception;


    TextWebSocketFrame encodeTextFrame() throws Exception;

    T decodeTextFrame(TextWebSocketFrame msg) throws Exception;

}
